home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / falcon / graphics / xgrabber.lzh / GFX->###.GFA (.txt) < prev    next >
GFA-BASIC Atari  |  1994-05-08  |  2KB  |  66 lines

  1. DIM regs%(15)
  2. ' ## INLINE:
  3. ' $0000: 53 80 72 0f 47 e8 00 10 76 00 e3 e3 d7 43 e3 e3 
  4. ' $0010: d7 43 e3 e3 d7 43 e3 e3 d7 43 e3 e3 d7 43 e3 e3 
  5. ' $0020: d7 43 e3 e3 d7 43 e3 e3 d7 43 34 f1 34 00 14 f1 
  6. ' $0030: 34 03 51 c9 ff d0 41 e8 00 10 53 80 6a c4 4e 75 
  7. ' 64  Bytes.
  8. INLINE asm_rout%,64
  9. DO
  10.   FILESELECT DIR$(0)+"\*.GFX","",fname$
  11.   EXIT IF fname$=""
  12.   RESERVE 50000
  13.   OPEN "i",#1,fname$
  14.   res$=INPUT$(38,#1)
  15.   pal256$=INPUT$(1024,#1)
  16.   pal16$=INPUT$(32,#1)
  17.   w#=(CVI(MID$(res$,39-6,2))+CVI(MID$(res$,39-4,2)))
  18.   h#=(CVI(MID$(res$,25,2))-CVI(MID$(res$,23,2)))/2
  19.   IF BTST(CVI(MID$(res$,31,2)),0)
  20.     h#=h#/2
  21.   ENDIF
  22.   IF BTST(CVI(MID$(res$,31,2)),1)
  23.     h#=h#*2
  24.   ENDIF
  25.   picsize%=LOF(#1)-38-1024-32
  26.   BGET #1,HIMEM,picsize%
  27.   IF BTST(CVI(MID$(res$,3,2)),4)
  28.     w#=w#*2
  29.     ziel%=HIMEM+picsize%
  30.     regs%(0)=w#*h#/16
  31.     regs%(8)=HIMEM
  32.     regs%(9)=V:pal256$
  33.     regs%(10)=ziel%
  34.     RCALL asm_rout%,regs%()
  35.     OPEN "o",#2,LEFT$(fname$,RINSTR(fname$,"."))+"RAW"
  36.     PRINT #2,w#;" ";h#;CHR$(10);
  37.     BPUT #2,ziel%,w#*h#*3
  38.     CLOSE #2
  39.     PRINT fname$," converted into RAW"
  40.     del
  41.   ELSE
  42.     IF BTST(CVI(MID$(res$,3,2)),8)
  43.       OPEN "o",#2,LEFT$(fname$,RINSTR(fname$,"."))+"TPI"
  44.       PRINT #2,"PNT"+CHR$(0)+MKI$(&H1000)+MKI$(0)+MKI$(w#)+MKI$(h#)+MKI$(&H10)+MKL$(&HE)+CHR$(&HA6);STRING$(109,CHR$(0));
  45.       BPUT #2,HIMEM,picsize%
  46.       CLOSE #2
  47.       PRINT fname$," converted into TPI"
  48.       del
  49.     ELSE
  50.       CLS
  51.       PRINT "Sorry!"
  52.       PRINT "I do only convert 256-color-pictures and"
  53.       PRINT "truecolor-pictures into RAW and TPI!"
  54.       ~INP(2)
  55.     ENDIF
  56.   ENDIF
  57.   CLOSE #1
  58. LOOP
  59. PROCEDURE del
  60.   ALERT 2,"Delete GFX-File?",1,"No|Yes",a#
  61.   IF a#=2
  62.     KILL fname$
  63.   ENDIF
  64.   CLS
  65. RETURN
  66.